package com.test.service;

import com.test.dao.UserDao;
import com.test.entity.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import java.util.List;

@Service
public class UserSercice {

    @Autowired
    private UserDao userDao;

    public Users userLogin(String u_acount, String u_password){
       return  userDao.userLogin(u_acount,u_password);
    }


    public Users managerLogin(String u_acount, String u_password){
        return  userDao.managerLogin(u_acount,u_password);
    }


    public  String  checkUser(String u_acount){
        return  userDao.checkUser(u_acount);
    }

    public  void  insertuser(String u_name,String u_acount,String u_password,String u_Identity){
        userDao.insertuser(u_name,u_acount,u_password,u_Identity);
    }

    public  void  manaCreateUser(String u_name,String u_acount,String u_Identity){
        userDao.manaCreateUser(u_name,u_acount,u_Identity);
    }

    public  int  deleteAcount(String u_acount){
        return userDao.deleteAcount(u_acount);
    }

    public  String  checkPwd(String u_acount){
        return userDao.checkPwd(u_acount);
    }

    public  int  updatepwd(String acount,String u_newpwd){
        return userDao.updatepwd(acount,u_newpwd);
    }

    public  int  insertStuBaseInfo(StuAllInfoDto stuAllInfoDto){
        return userDao.insertStuBaseInfo(stuAllInfoDto);
    }

    public  int  insertTeaBaseInfo(TeaAllInfoDto teaAllInfoDto){
        return userDao.insertTeaBaseInfo(teaAllInfoDto);
    }


    public  int  insertCompBaseInfo(CompAllInfoDto compAllInfoDto){
        return userDao.insertCompBaseInfo(compAllInfoDto);
    }

    public  int  insertCompRecruitInfo(CompAllInfoDto compAllInfoDto){
        return userDao.insertCompRecruitInfo(compAllInfoDto);
    }

     public   StuAllInfoDto selectStuBaseInfo(String acount){
        return userDao.selectStuBaseInfo(acount);
    }

    public   TeaAllInfoDto selectTeaBaseInfo(String acount){
        return userDao.selectTeaBaseInfo(acount);
    }

    public   CompAllInfoDto selectCompBaseInfo(String acount){
        return userDao.selectCompBaseInfo(acount);
    }

    public List<TeaAllInfoDto> selectAllTeacher(){
        return userDao.selectAllTeacher();
    }

    public   CompAllInfoDto selectCompRecruitInfo(String acount){
        return userDao.selectCompRecruitInfo(acount);
    }



    public   StuAllInfoDto selectStuStatusInfo(String acount){
        return userDao.selectStuStatusInfo(acount);
    }

    public   StuAllInfoDto selectStuJobInfo(String acount){
        return userDao.selectStuJobInfo(acount);
    }


    public  int  insertStuStatusInfo(StuAllInfoDto stuAllInfoDto){
        return userDao.insertStuStatusInfo(stuAllInfoDto);
    }

    public  int  insertStuJobInfo(StuAllInfoDto stuAllInfoDto){
        return userDao.insertStuJobInfo(stuAllInfoDto);
    }

    public  int  deleteStuBaseInfo(String u_acount){
        return userDao.deleteStuBaseInfo(u_acount);
    }

    public  int  deleteTeaBaseInfo(String u_acount){
        return userDao.deleteTeaBaseInfo(u_acount);
    }

    public  int  deleteCompBaseInfo(String u_acount){
        return userDao.deleteCompBaseInfo(u_acount);
    }

    public  int  deleteCompRecruitInfo(String u_acount){
        return userDao.deleteCompRecruitInfo(u_acount);
    }

    public  int  deleteStuStatusInfo(String u_acount){
        return userDao.deleteStuStatusInfo(u_acount);
    }

    public  int  deleteStuJobInfo(String u_acount){
        return userDao.deleteStuJobInfo(u_acount);
    }

    public  Users  findUserById(String u_acount){
        return userDao.findUserById(u_acount);
    }

    public  Users  findByUsername(User user){
        return userDao.findByUsername(user);
    }

}
